<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
    <h:head>
        <title>SCHEDULE</title>
    </h:head>
    <f:view beforePhase="#{scheduleController.initView}">
        <h:body>
            <h:form>  
                <!-- IDLE DIALOG for -->
                <p:confirmDialog message="You have been idle for 5 minutes. Do you want to continue?"  
                                 showEffect="bounce" hideEffect="explode"  
                                 header="Warning message" severity="alert" widgetVar="confirmation">  
                    <p:commandButton value="Yes" onclick="confirmation.hide()" type="button" /> 
                    <p:commandButton value="No" update="panel" oncomplete="confirmation.hide()"  
                                     actionListener="#{UserManagedBean.doLogout}" /> 
                </p:confirmDialog>

                <p:idleMonitor timeout="300000" onidle="confirmation.show()" />  
                <!--END OF IDLE DIALOG-->

                <p:ajaxStatus style="height:24px;display:block;">  
                    <f:facet name="start">  
                        <h:graphicImage value="25(2).gif" />  
                    </f:facet>  

                    <f:facet name="complete">  
                        <h:outputText value="" />  
                    </f:facet>  
                </p:ajaxStatus>  

                <p:growl id="messages" showDetail="true" />  

                <p:schedule value="#{scheduleController.eventModel}"  
                            editable="true" widgetVar="myschedule"  
                            eventSelectListener="#{scheduleController.onEventSelect}"  
                            dateSelectListener="#{scheduleController.onDateSelect}"  
                            eventMoveListener="#{scheduleController.onEventMove}"  
                            eventResizeListener="#{scheduleController.onEventResize}"  
                            onEventMoveUpdate="messages" onEventResizeUpdate="messages"  
                            onDateSelectUpdate="eventDetails" onDateSelectComplete="eventDialog.show()"  
                            onEventSelectUpdate="eventDetails" onEventSelectComplete="eventDialog.show()">  

                </p:schedule>  

                <p:dialog widgetVar="eventDialog" header="Event Details" showEffect="clip" hideEffect="clip">  
                    <h:panelGrid id="eventDetails" columns="2">  
                        <h:outputLabel for="title" value="Title:" />  
                        <p:inputText id="title" value="#{scheduleController.event.title}" />  

                        <h:outputLabel for="from" value="From:" />  
                        <p:inputMask id="from" mask="99/99/9999"  
                                     value="#{scheduleController.event.startDate}" >  
                            <f:convertDateTime pattern="dd/MM/yyyy" />  
                        </p:inputMask>  

                        <h:outputLabel for="to" value="To:" />  
                        <p:inputMask id="to" mask="99/99/9999"  
                                     value="#{scheduleController.event.endDate}" >  
                            <f:convertDateTime pattern="dd/MM/yyyy" />  
                        </p:inputMask>  

                        <h:outputLabel for="allDay" value="All Day:" />  
                        <h:selectBooleanCheckbox id="allDay"  
                                                 value="#{scheduleController.event.allDay}" />  

                        <p:commandButton type="reset" value="Reset" />  
                        <p:commandButton value="Save"  
                                         oncomplete="myschedule.update();eventDialog.hide();"  
                                         actionListener="#{scheduleController.addEvent}" />  
                    </h:panelGrid>  
                </p:dialog>  

            </h:form>  
        </h:body>
    </f:view>
</html>